# -*- coding: utf-8 -*-
"""
@Project ：PMS_AUTO_TEST 
@File    ：fun_convertible_bond_open.py
@Author  ：徐涛
@Date    ：2021/8/19 16:33
"""

import allure
from common.utils import Utils
from config.config import Config


class CBOpen:

    @allure.step('step:清理客户在网厅的在途数据')
    def initial_service_sql(self, client_id):
        if Config().env == 'test':
            Utils.search_for_param('oracle', 'sql/service_sql.json', 'initial_wt_CB_add_sql', [client_id],
                                   '清理客户在网厅的在途数据')
        else:
            assert True

    @allure.step('step:检查恒生柜台中的客户数据')
    def check_service_hs_sql(self, client_id):
        if Config().env == 'test':
            check_result = Utils.search_for_param('uf', 'sql/service_sql.json', 'check_hs_CB_add_sql', [client_id],
                                                  '检查恒生柜台中的客户数据')
            assert len(check_result) == 0, '客户未在恒生柜台开通相关权限'
        else:
            assert True
